package com.xiaoyg;

import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @author xiaoyg
 * @Title: Producer
 * @ProjectName spring-rabbitmq
 * @Description: TODO
 * @date 2018/12/516:50
 */
public class Producer {

    public static void main(String[] args) {

        ApplicationContext context = new ClassPathXmlApplicationContext("applicationContext.xml");
        AmqpTemplate amqpTemplate = context.getBean(RabbitTemplate.class);

        amqpTemplate.convertAndSend("test spring sync");

    }


}
